import { getWindowSize } from '@src/utils/utils'
// import { landscapeShaderMaterial } from '@src/core/shader'

/**
 * 窗口变化事件
 * width, height, halfX, halfY
 *
 * @param self
 */
export function setupResizeEvent(self) {
  const windowSize = getWindowSize()
  const { width, height } = windowSize

  self.$option = Object.assign({}, self.$option, windowSize)

  self.camera.aspect = width / height
  self.camera.updateProjectionMatrix()

  self.renderer.setSize( width, height )

  self.landscapeShaderMaterial.uniforms.scale.value = self.renderer.domElement.width / 1000
}


